﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using System.Data.SqlServerCe;

namespace CarCrash.Core
{
    public class NHibernateSchemeSetuper
    {
    
        private readonly Configuration cfg;

        public NHibernateSchemeSetuper(Configuration cfg)
        {
            this.cfg = cfg;
        }

        public void Install()
        {
            new SchemaExport(cfg).Execute(true, true, false);
        }

        public void Update()
        {
            new SchemaUpdate(cfg).Execute(true, false);
        }

        public void Uninstall()
        {
            new SchemaExport(cfg).Drop(true, true);
        }
    
    }
}